<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title></title>
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../css/aui-flex.css" />
	<style type="text/css">
		.aui-tab {
			position: fixed !important;
			width: 100%;
			z-index: 999;
			top: 0;
		}
	</style>
</head>

<body>
	<section class="aui-content">
		<div class="aui-tab" id="sorts">
			<div class="aui-tab-item aui-active" data-sort="1">综合优选</div>
			<div class="aui-tab-item" data-sort="2">销量爆单</div>
			<div class="aui-tab-item" data-sort="3">物美价廉</div>
			<div class="aui-tab-item" data-sort="4">佣金返利</div>
		</div>
		<section style="margin-top:2.4rem;" id="sort_top">
			<div class="aui-margin-10 aui-text-center"><img src="../image/sptj.png" width="65%" class="aui-margin-0 aui-text-center"></div>
			<div class="aui-flex-col aui-flex-center aui-flex-middle" id="div_goods_list">
			</div>
		</section>
		<!--加载loading-->
		<div class="index_loading">
			<img src="../image/index_loading.gif" />
			<span>加载中,请稍后...</span>
		</div>
		<div class="temporarily_data" style="display:none;">
			<img src="../image/no_date.png" />
		</div>
		<!--返回顶部-->
		<div class="gotoback" onclick="gotoback()" id="gotoback">
			<img src="../image/gotoback.png">
		</div>
	</section>
	<script id="tmpl_goods_list" type="text/x-dot-template">
		{{~it:vo:index}}
		<div class="aui-flex-item-6 aui-padded-5" tapmode onclick="openWinto('detail_win','widget://html/good_pdd_jd_detail_win',{source_type:'{{=sorts_data.source_type}}',goods_id:'{{=vo.goods_id}}',picurl:'{{=vo.picurl}}',picurls:'{{=vo.picurls}}',goods_name:'{{=vo.goods_name}}',sales:'{{=vo.sales}}',price:'{{=vo.price}}',price_pg:'{{=vo.price_pg}}',commission:'{{=vo.commission}}',price_after:'{{=vo.price_after}}',discount:'{{=vo.discount}}',start_time:'{{=vo.start_time}}',end_time:'{{=vo.end_time}}',cid:'{{=vo.pf_cid}}',cid1:'{{=vo.pf_cid1}}',cid2:'{{=vo.pf_cid2}}',cid3:'{{=vo.pf_cid3}}',couponurl:'{{=vo.couponurl}}',shopname:'{{=vo.shopname}}',shopid:'{{=vo.shopid}}',user_type:'{{=vo.user_type}}'})">
			<div class="aui-flex-row aui-flex-center aui-flex-middle aui-border-radius" style="box-shadow: 0 0 50px #dddddd;">
				<div class="pic aui-margin-0 aui-text-center"><img class="aui-border-radius-top goods_loading" style="background-color:#fff" onerror="this.src='../image/load-img.png'" src="../image/load-img.png" data-echo="{{=vo.picurl}}" height="180px" width="100%" max-height="180px"></div>
				<div class="aui-padded-5" style="background-color:#fff">
					<div class="itemtitle aui-ellipsis-2">{{? sorts_data.source_type=='pdd'}}<label class="pdd_font_style">拼多多</label>{{?? sorts_data.source_type=='jd'}}<label class="jd_font_style">JD</label>{{??}}<label class="aui-iconfont  aui-icon-{{?vo.user_type=='0'}}taobao aui-text-warning{{??}}tianmao aui-text-danger{{?}}"></label>{{?}}
						<label class="aui-font-size-14">{{=vo.goods_short_name}}{{=vo.goods_short_name}}{{=vo.goods_short_name}}{{=vo.goods_short_name}}</label>
					</div>
					<div class="aui-flex-col aui-flex-center aui-flex-middle">
						<div class="aui-flex-item-12  aui-text-left"><label class="aui-font-size-18" style="color:#FF3E96">￥{{=vo.price_after}}</label><del class="aui-font-size-12 aui-text-color-757575">￥{{=(vo.discount * 1+vo.price_after*1).toFixed(2)}}</del></div>
						<div class="aui-flex-item-7 aui-text-left">
							<label class="aui-label aui-bg-tag-quan aui-quan"><i>券{{=(vo.discount*1).toFixed(0)||0}}元</i></label>
						</div>
						<div class="aui-flex-item-5 aui-text-left"><label class="aui-font-size-12 aui-text-color-757575">已售{{?sorts_data.source_type=='pdd'}}{{=vo.sales}}{{??}}{{=changeW(vo.sales)}}{{?}}</label></div>
					</div>
				</div>
				<div style="color:#FFF;width:100%" class="aui-border-radius-bottom aui-text-center aui-font-size-14 {{? index%2==0}} aui-bg-tag-{{?sorts_data.source_type=='tb'}}tb{{??sorts_data.source_type=='pdd'}}pdd{{??}}vip{{?}}{{??}}aui-bg-tag-quan-1{{?}} "><label class=" aui-iconfont   aui-padded-r-5"></label>预估赚{{? isLoginOr()}}{{=(vo.commission * 0.01 * isLoginOr().yjrate).toFixed(2)}}{{??}}{{=(vo.commission * 1).toFixed(2)}}{{?}}元
				</div>
			</div>
		</div>
		{{~}}
	</script>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>
<script type="text/javascript" src="../script/utf.js"></script>
<script type="text/javascript" src="../script/echo.min.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/phpSerializer.js"></script>
<script type="text/javascript">
	apiready = function() {
		echo.init({
			offset: 0, // 指定距离视窗上下左右位置图片预加载 Number|String Default: 0
			throttle: 250, // 延迟加载  Number|String	Default: 250
			unload: false,
		});
		api.parseTapmode();
		Object.assign(sorts_data, api.pageParam);
	  console.log(JSON.stringify(sorts_data));
		sorts_data.cat = sorts_data.cat_id = sorts_data.cid;
		if (sorts_data.level == 2) {
			sorts_data.cid2 = sorts_data.cid;
			sorts_data.cid = '';
		} else if (sorts_data.level == 3) {
			sorts_data.cid3 = sorts_data.cid;
			sorts_data.cid = '';
		} else {
			sorts_data.cid1 = sorts_data.cid;
		}
		if (!sorts_data.source_type) {
			sorts_data.source_type = $api.getStorage('appSetInfo').indexshowtype;
		}
		if (sorts_data.sort_css && sorts_data.source_type == 'pdd') {
			$api.addCls($api.byId('sorts'), sorts_data.sort_css);
			$api.css($api.byId('sort_top'), 'margin-top:1px');
		}
		bodySrollChangeHeader();
		getindexGoodsList();
		getSortGoods('sorts', function(ret) {
			$('#div_goods_list').empty();
			sorts_data.sort = ret.sort;
			sorts_data.isloaded = false;
			sorts_data.pageindex = 1;
			getindexGoodsList();
		});
		getMoreGoods(function() {
			getindexGoodsList(true);
		});
		pullDown(function() {
			sorts_data.pageindex = 1;
			sorts_data.isloaded = false;
			$("#div_goods_list").empty();
			getindexGoodsList();
		}, {
			bgimg: 'icon_' + sorts_data.source_type + '.png'
		});
	};

	function getindexGoodsList(more) {
		if (more === true) {
			sorts_data.pageindex++;
		}
		getGoodsList(sorts_data.source_type, sorts_data, more);
	}
	function doSearchKeyword(keyword) {
	    sorts_data.keyword=keyword;
			sorts_data.pageindex = 1;
			sorts_data.isloaded = false;
			$("#div_goods_list").empty();
			getindexGoodsList();
	}
</script>

</html>
